import { req } from '@/util/request'
import type { ResData } from '@/types/index'
import type { ConfigTable } from '@/types/config'
/**
 * 获取公共配置
 * @returns 公共配置
 */
export function getPublicConfig(): ResData<ConfigTable[]> {
  return req.get('/config/public/all')
}

/**
 * 获取所有系统配置
 * @returns 所有配置
 */
export function getConfigAll(): ResData<ConfigTable[]> {
  return req.get('/config/sys/all')
}

/**
 * 保存系统配置
 * @param data 系统配置
 * @returns
 */
export function commitConfig(data: any): ResData<any> {
  return req.post('/config/update/sys', data)
}
